package Framework  
{
	import flash.events.KeyboardEvent;
	import flash.events.EventDispatcher;
	/**
	 * ...
	 * @author Menno
	 */
	public class BaseEventHandler 
	{
		private var _game:BaseGame;
		private static var _dispatcher:EventDispatcher;
		
		public function BaseEventHandler(game:BaseGame) 
		{
			_dispatcher = new EventDispatcher();
			_game = game;	
			addKeyBoardListener();			
		}
		
		protected function addKeyBoardListener():void
		{
			_game.addEventListener(KeyboardEvent.KEY_DOWN, downKey);
			_game.addEventListener(KeyboardEvent.KEY_UP, upKey);
			
			trace();
		}
		
		protected function upKey(e:KeyboardEvent):void 
		{		
			trace("hai");
		}
		
		protected function downKey(e:KeyboardEvent):void 
		{
			trace("hai");
		}
		
				
		static public function get dispatcher():EventDispatcher 
		{
			return _dispatcher;
		}
	}
	
}